package com.jia.service;

import com.jia.adpter.MapAdpater;
import com.jia.entity.Role;

import javax.jws.WebService;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by jia on 2018/4/11.
 */
@WebService
public class UserDaoImpl implements UserDao {

    @Override
    //@WebMethod(exclude = true)
    public Map<String, ArrayList<Role>> getUserRoles() {
        Map<String, ArrayList<Role>> re = new HashMap<>();
        ArrayList<Role> list = new ArrayList<>();
        list.add(new Role(1, "王者"));
        list.add(new Role(2, "星耀"));
        re.put("贾武伟", list);
        ArrayList<Role> list1 = new ArrayList<>();
        list1.add(new Role(3, "青铜"));
        re.put("贾喜龙", list1);
        return re;
    }

    @Override
    public ArrayList<Role> getRoleByUserName(String name) {
        ArrayList<Role> roles = new ArrayList<>();
        roles.add(new Role(1, "王者"));
        roles.add(new Role(2, "星耀"));
        if ("贾武伟".equals(name)) {

            return roles;
        }
        return null;
    }
}
